import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

//导入router
import router from './router'
//导入pinia
import {createPinia} from 'pinia'

//导入elementplus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import piniaPersist from 'pinia-plugin-persistedstate';
 
const app = createApp(App)
app.use(router)
app.use(ElementPlus)

const pinia = createPinia();
pinia.use(piniaPersist);  // 添加插件

// 全局注册 Element Plus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.use(pinia)
app.mount('#app')
